<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<title>修改供应商信息</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/sources/css/style.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/sources/scripts/jquery-3.4.1.min.js"></script>
<script type="text/javascript">
		function editShop(){
			
			var shop_name=$("#shop_name").val();
			if(shop_name==""){
				alert("店铺名称不能为空");
				return;
			}
			//发送ajax请求
			var url="${pageContext.request.contextPath}/shop/edit_shop";//访问地址
			var param=$("#form").serialize();//参数
			$.post(url,param,function(data){
				if(data=="1"){
					window.location.href="${pageContext.request.contextPath}/shop/shop_list";
					return;
				}else{
					alert(data);
				}
			});
		}
</script>
<body>
	<!-- Table goes in the document BODY -->
	<form id="form">
		<table class="hovertable">
			<tr>
				<th colspan="2">修改供应商信息</th>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>店铺名称</td><td><input id="shop_name" type="text" name="shop_name" value="${shop.shop_name }"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>店铺地址</td><td><input id="shop_address" type="text" name="proName" value="${shop.shop_address }"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>店铺类型</td><td><input type="text" name="shop_type" value="${shop.shop_type }"></td>
			</tr>
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>店铺头像</td><td><input type="text" name="shop_picture" value="${shop.shop_picture }"></td>
			</tr>
			
			<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';">
				<td>店铺详情</td><td><textarea cols=30 rows=5 name="shop_desc" >${shop.shop_desc }</textarea></td>
			</tr>
			 <tr style="background-color:#ffffff;text-align:center">
			 
			 	<input type="hidden" name="shop_id" value="${shop.shop_id}">
				<td colspan="2"><input type="button" onclick="editShop()" value="提交" style="width:100%"></td>
			</tr>
		</table>
	</form>
</body>
</html>